<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <div class="section">
                <h1>Visualizando Construtora</h1>
                <h:form id="formConstruction">
                    <p:growl id="msg" life="3000"/>
                    <div class="container_24 clearfix">
                        <p:panel header="Dados Gerais" >
                            <p:outputLabel value="Nome:" styleClass="grid_3" />
                            <p:inputText readonly="true" value="#{managerViewCostruction.construction.name}" styleClass="grid_20 ajustInput"  />
                            
                            <p:outputLabel value="Razão Social:" styleClass="grid_3 companyLabel" />
                            <p:inputText readonly="true" value="#{managerViewCostruction.construction.companyName}" styleClass="grid_20 ajustInput" />
                        
                            <p:outputLabel value="CNPJ:" styleClass="grid_3" />
                            <p:inputMask readonly="true" value="#{managerViewCostruction.construction.cnpj}" 
                                         mask="99.999.999/9999-99" styleClass="grid_8"  />
                            
                            <p:outputLabel value="Telefone:" styleClass="grid_3" />
                            <p:inputMask readonly="true" value="#{managerViewCostruction.construction.fone}" 
                                         mask="(99) 9999-9999" styleClass="grid_8" />
                            <div class="clear"/>
                        </p:panel>
                        
                        <p:panel header="Endereço" >
                            <p:outputLabel value="CEP:" styleClass="grid_3" />
                            <p:inputText readonly="true" va8lue="#{managerViewCostruction.construction.address.cep}" styleClass="grid_8"  />
                            <div class="clear-both" />
                            
                            <p:outputLabel value="Rua:" styleClass="grid_3" />
                            <p:inputText readonly="true" value="#{managerViewCostruction.construction.address.patio}" styleClass="grid_20 ajustInput" />
                           
                            <p:outputLabel value="Complemento:" styleClass="grid_3 complementLabel" />
                            <p:inputText readonly="true" value="#{managerViewCostruction.construction.address.complement}" styleClass="grid_20 ajustInput" />
                            
                            <p:outputLabel value="Bairro:" styleClass="grid_3" />
                            <p:inputText readonly="true" value="#{managerViewCostruction.construction.address.district}" styleClass="grid_8" />
                            
                            <p:outputLabel value="Nº:" styleClass="grid_3" />
                            <p:inputText readonly="true" value="#{managerViewCostruction.construction.address.num}" styleClass="grid_8" />
                            
                            <p:outputLabel value=" Cidade: " styleClass="grid_3"  />
                            <p:inputText readonly="true" value="#{managerViewCostruction.city.name}" styleClass="grid_8" />
                            
                            <p:outputLabel value="Tipo:" styleClass="grid_3"/>
                            <p:inputText readonly="true" value="#{managerViewCostruction.construction.address.typeAddress.name}" styleClass="grid_8"/>
                            <div class="clear"/>

                        </p:panel>
                        
                        <p:panel header="Representantes">
                            <p:dataTable id="tableCustomer" var="customer" value="#{managerViewCostruction.customers}" 
                                        styleClass="grid_24"
                                        rowIndexVar="rowid"
                                        emptyMessage="Nenhum registro">  
                                <p:column headerText="Nome" width="300">  
                                    <h:outputText value="#{customer.name}"/>
                                </p:column>  
                                <p:column headerText="CPF">  
                                    <h:outputText value="#{customer.cpf}" />
                                </p:column>
                                <p:column headerText="Telefone">  
                                    <h:outputText value="#{customer.fixedPhone}"/>
                                </p:column>

                            </p:dataTable>
                            <div class="clear" />
                        </p:panel>
                        <div class="buttonAction">
                            <p:button value="Voltar" href="searchconstruction.xhtml" icon="ui-icon-arrowreturnthick-1-w"/>
                        </div>
                    </div>
                </h:form>
            </div>
        </ui:define>
    </ui:composition>

</html>
